package com.kylin.core.user.event.listener;

import com.kylin.core.user.event.repository.UserDataHandler;
import com.kylin.domain.user.event.WechatUserCreatedEvent;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.axonframework.eventhandling.EventHandler;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Damon S.
 * @version v1.0.1
 * @date 2020年11月22日 20:07
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class UserEventListener {

    private final UserDataHandler userDataHandler;

    @EventHandler
    @Transactional(rollbackFor = Exception.class)
    void on(WechatUserCreatedEvent event) {
        // 保存商品信息
//        this.userDataHandler.create(event);
    }
}
